// 请求
let p = new Promise((resolve, reject) => {
    $.ajax({
        url: "",
        dataType:"",
        success: success => {
            resolve(success)
        },
        error: error => {
            reject(error)
        }
    })
})


// 返回数据
p.then(success => {
    console.log(success);
}, error => {
    console.log(error);
})

// Promise.all

Promise.all([
    p1,p2,p3
]).then(success => {
    let [res1, res2, res3] = success
    console.log(res1);
    console.log(res2);
    console.log(res3);
}, error => {
    console.log('至少有一个失败了');
})